package com.xinqi.modules.sys.dict.manager;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.mybatis.data.service.BaseService;
import com.xinqi.modules.sys.dict.domain.DictStageGradeEntity;
import com.xinqi.modules.sys.dict.dto.req.DictStageGradeQueryDTO;
import com.xinqi.modules.sys.dict.dto.rsp.DictGradeResultDTO;
import com.xinqi.modules.sys.dict.dto.rsp.DictStageGradeResultDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 字典-学段年级管理层
 *
 * @author: linkai
 * @date: 2023/05/03
 */
public interface DictStageGradeManager extends BaseService<DictStageGradeEntity> {

    /**
     * 自定义分页查询
     */
    Page<DictStageGradeResultDTO> findPage(Page<Object> page, DictStageGradeQueryDTO query);

    /**
     * 自定义列表查询
     */
    List<DictStageGradeResultDTO> findList(DictStageGradeQueryDTO query);

    /**
     * 根据id查询 字典-学段年级数据
     */
    DictStageGradeEntity findById(Long id);

    /**
     * 根据id删除 字典-学段年级数据
     */
    @Transactional(rollbackFor = Exception.class)
    boolean deleteById(Long id);

    List<DictGradeResultDTO> findGradeByStageId(Long stageId);

    List<DictGradeResultDTO> findGradeByVersionId(Long versionId);

    @Transactional(rollbackFor = Exception.class)
    Boolean addGrade(Long stageId, List<Long> gradeIdList);

    @Transactional(rollbackFor = Exception.class)
    Boolean delGrade(Long stageId);
}
